<?php
class Zend_View_Helper_MenuMaker extends Zend_View_Helper_Abstract
{
	public function menuMaker($links = array(
	   'index'=>
			array(
			      'action'=>'index','message'=>'Product manager'
				  ),
		'category'=>
			array('action'=>'index','message'=>'Category manager'
				  ),
		'user'=>
			array('action'=>'index','message'=>'User manager'
				  )
		)
	)
	{


		//$url = new Zend_View_Helper_UrlMaker();


		$menu = '<ul>';
		foreach ($links as $controller=>$actions){
				$menu .= '<li>';
				$menu .= self::urlMaker($controller, $links[$controller]['action'], $links[$controller]['message']);
				$menu .= '</li>';
		}
		return $menu.'</ul>';
	}

	private static function urlMaker($controller, $action = 'index', $message = ''){
		$_url =  new Zend_View_Helper_Url();
		$url = $_url->url(array('controller' => $controller, 'action' => $action));

		$archor = '<a href='.$url.'>'.$message.'</a>';

		return $archor;

	}
}


